{% extends 'extends/base_after_login.html' %}

{% block base_after_login_main %}
    {% from 'macro/card/../../macro/base/../../macro/card/base_card.html' import m_card %}
    {% from 'macro/card/../../card/personal/personal.html' import m_personal %}

    {{ m_personal(username=username, role=role, text=text, img_url=img_url) }}

    {% set card1_head %}
        <h4>更新个人信息</h4>
    {% endset %}

    {% set card1_body %}
        <form method="POST" enctype="multipart/form-data">
            {{ form1.hidden_tag() }}
            <div class="form-group">
                <label for="img">头像</label>
                {{ form1.img(class="form-control-file") }}
            </div>
            <div class="form-group">
                <label for="text">简介</label>
                {{ form1.text(class="form-control", placeholder="介绍下你自己吧") }}
            </div>
            <button type="submit" name="submit1" class="btn btn-primary btn-block">{{ form1.submit.label }}</button>
        </form>
    {% endset %}

    {{ m_card(head=card1_head, body=card1_body | safe, collapse=False) }}

    {% set card2_head %}
        <h4>身份验证</h4>
    {% endset %}

    {% set card2_body %}
        {% if not (status == 1 and unpass == 0) %}
        <form method="POST" enctype="multipart/form-data">
            {{ form2.hidden_tag() }}
            <div class="form-group">
                <label for="img">上传身份证明文件</label>
                {{ form2.img(class="form-control-file") }}
            </div>
            <div class="form-group">
                <label for="role">身份选择</label>
                {{ form2.role(class="form-control") }}
            </div>
            <button type="submit" name="submit2" class="btn btn-primary btn-block">{{ form2.submit.label }}</button>
        </form>
    {% endif %}
    {% endset %}

    {% from 'macro/prove/../../macro/label/prove.html' import m_prove %}

    {{ m_card(head=card2_head, body=card2_body | safe,footer=m_prove(status,unpass), collapse=False) }}

{% endblock %}
